sudo sh -c "echo 'deb http://hudson-ci.org/debian binary/' > /etc/apt/sources.list.d/hudson.list";
sudo apt-get update
sudo apt-get install hudson
sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
sudo curl -L get.rvm.io | bash -s stable
sudo source /usr/local/rvm/scripts/rvm
sudo curl -L get.rvm.io | bash -s stable --rails
sudo apt-get install nodejs
sudo apt-get install mysql-server mysql-client libmysql-ruby libmysqlclient-dev
sudo gem install mysql2
sudo gem install thin
sudo thin install
sudo /usr/sbin/update-rc.d -f thin defaults
sudo thin config -C /etc/thin/ruby.yml -c /var/lib/hudson/jobs/ruby/trunk/trunk/DatabaseTest
sudo apt-get install mingetty
sudo sh -c "echo 'cd /var/lib/hudson/jobs/ruby/trunk/trunk/DatabaseTest' >> ~/.bashrc";
sudo sh -c "echo 'thin start -C /etc/thin/ruby.yml' >> ~/.bashrc";
sudo sh -c "echo 'cd ~' >> ~/.bashrc";